
function addCombo() {
    var entry_type = document.getElementById("id_entry_type");
    var combo = document.getElementById("id_entry_field");
    combo.options.length=0;
    var option = document.createElement("option");
    var option2= document.createElement("option");
    var option3= document.createElement("option");	
    var search_box=document.getElementById("AppRic");
   

    //search_box.value="search for PIMs...";
  
if(entry_type.value!="-1"){
    search_box.disabled=false;
    if(entry_type.value=="0"){
	option.text="Name";
	option.value="name";  
	try {
		combo.add(option, null); //Standard
    	}catch(error) {
        	combo.add(option); // IE only
    	}
    
    }
    else{	
	option.text="Summary";
	option.value="summary";
	option2.text="Description";
	option2.value="description";
	if(entry_type.value=="1"){
	   option3.text="Event start (YYYY-MM-DD)";
	   option3.value="dtstart";
	}
     

        try {
		combo.add(option, null); //Standard
		combo.add(option2,null);
		if(entry_type.value=="1"){
			combo.add(option3,null);
		}
	}catch(error) {
        	combo.add(option); // IE only
		combo.add(option2);
		if(entry_type.value=="1"){
			combo.add(option3);
		}
	}
   }

}else{
	search_box.disabled=true;
}
}
